package com.boat.starter.jetcache.props;

import org.springframework.boot.context.properties.NestedConfigurationProperty;

import lombok.Data;

/**
 * jetcache配置
 * @author 周江
 *
 */
@Data
public class JetcacheProperties {
	@NestedConfigurationProperty
	private LocalConfig local = new LocalConfig();

	@NestedConfigurationProperty
	private RemoteConfig remote = new RemoteConfig();

	@Data
	public static class LocalConfig {
		// 默认超时时间5分钟：5*60*1000
		private int expireAfterWriteSeconds = 300000;
		private int limit = 200;
	}

	@Data
	public static class RemoteConfig {
		private String host;
		private int port = 6379;
		private String password;
		private int database = 0;
		// 默认超时时间1小时：60*60*1000
		private int expireAfterWriteSeconds = 3600000;
		private int timeout = 2000;
		//连接池参数
		private int poolMinIdle = 0;
		private int poolMaxIdle = 16;
		private int poolMaxTotal = 16;
	}
}
